<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
//Route::post('/Reg/reg','RegController@reg');

//测试中间件使用
//Route::any('/Reg/reg','RegController@reg')->middleware('cs');

//仅post和get可访问
Route::match(['get','post'],'/Reg/reg','RegController@reg')->middleware('cs');

//重定向
//Route::redirect('/Reg/reg', '/there', 301);

//所有请求方式都可访问
//Route::any('/Reg/reg','RegController@reg')->middleware('cs');